/**
 * Created with IntelliJ IDEA
 * Description:
 * User: Administrator
 * Data: 2023 - 09 - 10
 * Time: 11:52
 */
//牛客 跳台阶
public class Solution7 {
    public int jumpFloor (int number) {
        if(number == 1) return 1;
        if(number == 2) return 2;
        int a = 1, b = 2, ret = 0;
        for (int i = 3; i <= number; i++) {
            ret = a + b;
            a = b;//注意是从前向后赋值，从后向前赋值不行
            b = ret;
        }
        return ret;
    }
}
